package cn.lixin.basic.utils;

import lombok.Data;

@Data
public class AjaxResult {
    private Boolean success = true;
    private String  message = "操作成功";

    /*
     * 文件上传删除时所需要的路径
     *登录的时候需要返回
     */
    private Object resultObj;

    public static AjaxResult me(){
        return new AjaxResult();
    }

    /**
     * 链式编程 ，返回一个AjaxResult 可以一直点“.”
     * @param success
     */
    public AjaxResult setSuccess(Boolean success) {
        this.success = success;
        return this;
    }

    public AjaxResult setMessage(String message) {
        this.success = false;
        this.message = "操作失败";
        return this;
    }

    public AjaxResult setResultObj(Object resultObj) {
        this.resultObj = resultObj;
        return this;
    }
}
